
<script setup lang="ts">
import { ref } from 'vue'

const age = ref(18)
const changAge = () => {
  age.value++
  console.log(age.value)
}
</script>


<template>
  <div>
    年龄:<span>{{ age }}</span>
    <!-- <button v-on:click="age++"></button> -->
    <!-- 处理函数 -->
    <button @click="changAge">点我</button>
  </div>
</template>